﻿<%@ Page Title="Redfield Weather (49120)" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" Async="true" MaintainScrollPositionOnPostback="true"
    CodeBehind="Default.aspx.cs" Inherits="RedfieldWeather._Default" %>

<%@ Register Src="~/CurrentForecast.ascx" TagPrefix="uc" TagName="CurrentForecast" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
	<h1>
		Current Conditions
    </h1>
	<asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="2000"></asp:Timer>
	<asp:UpdatePanel ID="uiUpdatePanel" runat="server">
		<Triggers>
			<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
		</Triggers>
		<ContentTemplate>
			<uc:CurrentForecast runat="server" ID="CurrentForecast" />
		</ContentTemplate>
	</asp:UpdatePanel>
	<br />
	<hr />
		<div id="divAlerts" runat="server" visible="false">
			<h1 class="alerts">Alerts</h1>
			<asp:Repeater ID="rptAlerts" runat="server">
				<HeaderTemplate>
					<table border="0">
				</HeaderTemplate>
				<ItemTemplate>
					<tr>
						<td colspan="4"><h3><span class="alerts"><%# DataBinder.Eval(Container.DataItem, "Description")%></span></h3></td>
					</tr>
					<tr>
						<td width="20"></td>
						<td nowrap="nowrap" class="bold">Date time</td>
						<td width="5"></td>
						<td><%# DataBinder.Eval(Container.DataItem, "DateTime")%></td>
					</tr>
					<tr>
						<td width="20"></td>
						<td nowrap="nowrap" class="bold">Exipres</td>
						<td width="5"></td>
						<td><%# DataBinder.Eval(Container.DataItem, "Expires")%></td>
					</tr>
					<tr>
						<td width="20"></td>
						<td nowrap="nowrap" valign="top" class="bold">Message</td>
						<td width="5"></td>
						<td><%# DataBinder.Eval(Container.DataItem, "Message")%></td>
					</tr>
				</ItemTemplate>
				<FooterTemplate>
					</table>
				</FooterTemplate>
			</asp:Repeater>
			<br />
			<hr />
		</div>
    	<h1>Weather Underground Forecast</h1>
		<asp:Repeater ID="rptForecast" runat="server">
			<HeaderTemplate>
				<table border="0">
			</HeaderTemplate>
			<ItemTemplate>
				<tr>
					<td colspan="2"><h3><span class="bold"><%# DataBinder.Eval(Container.DataItem, "Title")%></span></h3></td>
				</tr>
				<tr>
					<td valign="top"><img src='<%# DataBinder.Eval(Container.DataItem, "Icons['Incredible']")%>' /></td>
					<td valign="top"><%# DataBinder.Eval(Container.DataItem, "Description")%></td>
				</tr>
			</ItemTemplate>
			<FooterTemplate>
				</table>
			</FooterTemplate>
		</asp:Repeater>
		<br />
		<hr />
		<h1>Almanac</h1>
		<table>
			<tr>
				<td nowrap="nowrap" class="bold">Sunrise</td>
				<td width="5"></td>
				<td align="right"><asp:Label ID="lblSunrise" runat="server"></asp:Label></td>
			</tr>
			<tr>
				<td nowrap="nowrap" class="bold">Sunset</td>
				<td width="5"></td>
				<td align="right"><asp:Label ID="lblSunset" runat="server"></asp:Label></td>
			</tr>
			<tr>
				<td nowrap="nowrap" class="bold">Moon Day</td>
				<td width="5"></td>
				<td align="right"><asp:Label ID="lblMoonAge" runat="server"></asp:Label></td>
			</tr>
			<tr>
				<td nowrap="nowrap" class="bold">Moon Percentage</td>
				<td width="5"></td>
				<td align="right"><asp:Label ID="lblMoonPct" runat="server"></asp:Label>%</td>
			</tr>
		</table>
</asp:Content>

